#!/usr/bin/env perl

use Time::HiRes qw(time);

# use Inline C => DATA =>
	# MYEXTLIB => '/root/source/iputils-s20101006/libping6.so',
	# TYPEMAPS => './typemap';

use Inline C => DATA =>
	LIBS => '-L/root/source/iputils-s20101006/ -lping6',
	TYPEMAPS => './typemap';

for (1 .. 10) {
	$t=time();
	$res=myping("::1");
	printf("%.5f seconds\n",time()-$t);
}
print "res=$res\n";
if($res<0) {
	print STDERR "Error: " . myping_error() . "\n";
}

__END__

__C__
#include "libping6.h"
void hello() {
	printf("Hello world2\n");
}

float myping(char *addr) {
	return libping6_ping(addr,NULL,0,0);
}

char *myping_error() {
	return libping6_ping_errstr();
}

